{include file="header.html"}
<script type="text/javascript" src="/plugin/ueditor/ueditor.config.js"></script>
<script language="javascript" src="/plugin/ueditor/ueditor.all.min.js"></script>

<script language="javascript">
options={
		initialFrameWidth:"100%",
		imageUrl:"/index.php?m=upload&a=UeImg&dir=product&siteid={const.SITEID}&id={$data.id}" ,
		fileUrl:"/index.php?m=upload&a=UeFile&dir=product&siteid={const.SITEID}&id={$data.id}",
		catcherUrl:"/index.php?m=upload&a=UeRemote&dir=product&siteid={const.SITEID}&id={$data.id}"
		 
};
var editor=UE.getEditor('content',options)
</script>
<script language="javascript" src="/plugin/jquery/ajaxfileupload.js"></script>
<script language="javascript">
   function uploadgoodsimg()
    {
        //starting setting some animation when the ajax starts and completes
        $("#loading")
        .ajaxStart(function(){
            $(this).show();
        })
        .ajaxComplete(function(){
            $(this).hide();
        });

        $.ajaxFileUpload
        (
            {
                url:'/index.php?m=upload&a=uploadtao&dir=product&siteid={const.SITEID}&id={$data.id}&t='+Math.random(), 
                secureuri:false,
                fileElementId:'upimg',
                dataType: 'json',
                success: function (data, status)
                {
                    if(typeof(data.error) != 'undefined')
                    {
                        if(data.error != '')
                        {
                           alert(data.msg);
                        }else
                        {
                             $("#imgShow").html("<img src='/"+data.imgurl+".100x100.jpg' width='100'>");
							 $("#imgurl").val(data.imgurl);
                        }
                    }
                },
                error: function (data, status, e)
                {
					alert(data.msg)
  
                }
            }
        )
        
        return false;

    }
</script>
<div  >
<div class="row">
<div  >
{include file='brand/nav.html'}
<form method='post' action='{$appadmin}?m=brand&a=save'>
<input type='hidden' name='id' style='display:none;' value='{$data.id}' >
 <table class='table table-bordered' width='100%'>
  <tr><td width="50">品牌名：</td><td><input type='text' name='title' id='title' value='{$data.title}' ></td></tr>
   <tr>
    <td width="100" align="right">图片：</td>
    <td>
    <div class="btn-upload">
      <input type="file" name="upimg" class="btn-upload-file" id="upimg" onChange="uploadgoodsimg()">
      </div>
      <label  id="loading" style="color:red; display:none;">正在上传中...</label>
      <input type="hidden" name="logo" id="imgurl" value="{$data.logo}">
      <span id="imgShow">
      {if $data.logo}
      <img src="/{$data.logo}.100x100.jpg">
      {/if}
      </span>
      </td>
  </tr>
  
  <tr><td>首页显示</td><td><input type="radio" name="isindex" value="1" {if $data.isindex eq 1} checked{/if}>是 <input type="radio" name="isindex" value="0"  {if $data.isindex neq 1} checked{/if}>否</td></tr>

  <tr><td>状态：</td><td>
  显示<input type='radio' name='status' id='status' value='1' {if $data.status eq 1} checked="checked"{/if} > 
  隐藏<input type='radio' name='status' id='status' value='0' {if $data.status eq 0} checked="checked"{/if}></td></tr>
  
   
  <tr><td>排序：</td><td><input type='text' name='orderindex' id='orderindex' value='{$data.orderindex}' ></td></tr>
    {if $data}<tr><td>时间：</td><td>{$data.dateline|date:Y-m-d H:m}</td></tr>{/if}
  <tr>
    <td align="right">描述：</td>
    <td><textarea id="description" name="description" style="width:400px; height:50px;" >{$data.description}</textarea></td>
  </tr>
  <tr>
    <td align="right">内容：</td>
    <td><script type="text/plain" id="content" name="content" >{$data.content}</script></td>
  </tr>
<tr><td></td><td><input type='submit' value='保存' class='btn btn-success'></td></tr> </table>
</form>
</div>
</div>
</div>
{include file="footer.html"}